package com.baidu.shoppingmall.order.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.baidu.shoppingmall.common.util.DateUtils;
import com.baidu.shoppingmall.order.domain.OrderInfoDTO;
import com.baidu.shoppingmall.order.domain.OrderItemDTO;
import com.baidu.shoppingmall.order.service.OrderInfoService;
import org.springframework.stereotype.Service;


/**
 *
 * @author yjf
 *
 */
@Service
public class OrderInfoServiceImpl implements OrderInfoService {

	/**
	 * 查询确认收货时间超过了7天而且还没有发表评论的订单
	 * @return 订单
	 */
	@Override
	public List<OrderInfoDTO> listNotPublishedCommentOrders() throws Exception {
		List<OrderInfoDTO> orderInfoDTOS = new ArrayList<>();

		OrderInfoDTO orderInfoDTO = new OrderInfoDTO();

		orderInfoDTO.setId(1L);

		String confirmDate = "2020-10-09 09:09:09";
		Date date = DateUtils.parseDatetime(confirmDate);

		orderInfoDTO.setConfirmReceiptTime(date);

		OrderItemDTO orderItemDTO = new OrderItemDTO();
		orderItemDTO.setGoodsId(3L);



		List<OrderItemDTO> orderItemList = new ArrayList<>();
		orderItemList.add(orderItemDTO);

		orderInfoDTO.setOrderItems(orderItemList);

		return orderInfoDTOS;
	}
}
